//服务器缓存
"use strict"
const dbase = require("./dbase")
const cmds = ['get', 'set', 'del', 'ttl', 'incr', 'exists', 'expire'];


function cache(sid, name, format) {
    let redis = new dbase.gzone.cache(sid, name, format);
    for (let k of cmds) {
        this[k] = function (uid, key, ...arg) {
            arg.unshift([uid, key]);
            return redis[k].apply(redis, arg);
        }
    }
}




module.exports = cache;